<script>
$(document).ready(function(){

	var c = {
		findcode:'',
		initv:function(){
			xcy.bodyflow(1);
			js.initbtn(this);
			this.findcode = js.getoption('findcode')
			if(this.findcode=='1')get('yzmdiv').style.display='flex';
		},
		submit:function(o1){
			var da = js.getformdata('myform{rand}');
			if(!da.name || !da.mobile || !da.pass || !da.pass1){
				js.show.error('所有表单都必须输入');return;
			}
			var pass = da.pass;
			if(!/[a-zA-Z]{1,}/.test(pass) || !/[0-9]{1,}/.test(pass)){
				js.show.error('新密码必须使用字母+数字');
				return false;
			}

			if(pass!=da.pass1){
				js.show.error('确认密码不一致');
				return false;
			}
			o1.disabled = true;
			
			js.ajax.post({
				data:da,
				url:'login/find',
				loading:'找回中...',
				loadsuccess:'找回成功',
				ntoken:true,
				onerror:function(){
					o1.disabled = false;
				}
			},function(ret){
				js.back();
			});
			
		},
		back:function(){
			js.back();
		},
		getcode:function(o){
			var sj = jsform('mobile','myform{rand}').value;
			if(!sj || !js.check.iscnmobile(sj)){js.show.error('请输入正确手机号');return}
			o.innerHTML='获取中';
			o.disabled=true;
			js.ajax.get({
				url:'login/findcode',
				data:{
					mobile:sj
				},
				onerror:function(){
					o.innerHTML='获取';
					o.disabled=false;
				}
			},function(ret){
				js.msg('success','验证码已发送')
				c.daojishi(o,60);
			});
		},
		daojishi:function(o,sj){
			if(sj==0){
				o.innerHTML='重新获取';
				o.disabled = false;
				return;
			}
			o.innerHTML=''+sj+'';
			setTimeout(function(){
				c.daojishi(o, sj-1);
			},1000);
		}
	}
	c.initv();
});
</script>


<div align="center" style="padding:15px 10px">
	<form name="myform{rand}" autocomplete="off">
	
	
	<div style="max-width:410px;" align="left">
		<div style="padding:10px 5px 2px 10px;" class="hui fontsize12">验证信息</div>
		<div class="rock-panel rock-border rock-radius rock-list-group">
			<div class="rock-list-item" style="display:flex">
				<span style="width:60px;line-height:30px">姓名</span>
				<input style="flex:1" maxlength="50" class="input" name="name" placeholder="平台上的姓名">
			</div>
			<div class="rock-list-item" style="display:flex">
				<span style="width:60px;line-height:30px">手机号</span>
				<input style="flex:1" maxlength="20" value="" class="input" name="mobile" placeholder="输入您手机号">
			</div>
			
			<div class="rock-list-item" id="yzmdiv" style="display:none">
				<span style="width:60px;line-height:30px">验证码</span>
				<input style="flex:1;border-radius:5px 0px 0px 5px" maxlength="6" name="yzm" class="input" placeholder="手机验证码">
				<button type="button" clickevt="getcode" style="border-radius:0px 5px 5px 0px;border-left-width:0px" class="webbtn webbtn-default">获取</button>
			</div>
			
		</div>
	
	</div>
	
	<div style="max-width:410px;" align="left">
		<div style="padding:15px 5px 2px 10px;" class="hui fontsize12">重新设置密码</div>
		<div class="rock-panel rock-border rock-radius rock-list-group">
			<div class="rock-list-item" style="display:flex">
				<span style="width:60px;line-height:30px">新密码</span>
				<input style="flex:1" name="pass" class="input" type="password" placeholder="至少4位数字字母组合">
			</div>
			<div class="rock-list-item" style="display:flex">
				<span style="width:60px;line-height:30px">确认</span>
				<input style="flex:1" name="pass1" class="input" placeholder="请输入确认的密码">
			</div>
			
			
			
		</div>
	</div>
	
	</form>
	<div style="margin-top:30px"><input clickevt="submit" style="width:150px" type="button" value="确定" class="webbtn"></div>	
	<div style="margin-top:10px"><a clickevt="back" class="hui">&lt;返回</a></div>	

</div>